"""
一个回合制游戏，每个角色都有hp 和power，hp代表血量，power代表攻击力，
hp的初始值为1000，power的初始值为200。
定义一个fight方法：
my_final_hp = my_hp - enemy_power
enemy_final_hp = enemy_hp - my_power
两个hp进行对比，血量剩余多的人获胜
"""
def fight():
    my_hp = 1000
    my_power = 200
    enemy_hp = 990
    enemy_power = 190

    my_final_hp = my_hp - enemy_power
    enemy_final_hp = enemy_hp - my_power

    if my_final_hp > enemy_final_hp:
        print("我赢了")
    elif my_final_hp < enemy_final_hp:
        print("我输了")
    else:
        print("平局")

# fight()

def fight2(my_hp, my_power, enemy_hp, enemy_power):
    my_final_hp = my_hp - enemy_power
    enemy_final_hp = enemy_hp - my_power

    if my_final_hp > enemy_final_hp:
        print("我赢了")
    elif my_final_hp < enemy_final_hp:
        print("我输了")
    else:
        print("平局")

fight2(1500, 200, 1990, 210)
